package com.example.mapper;

import com.example.pojo.dto.HeadDto;
import com.example.pojo.entity.Activity;
import com.example.pojo.entity.Head;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface HeadMapper {
   @Insert("insert into  `head` (user_id,title,museum_id,activity_id) values (#{userId},#{title},#{museumId},#{activityId})")
    void insert(Head head);

   @Update("update `head` set name = #{name},title = #{title},museum = #{museum},activity = #{activity},email = #{email},phone = #{phone} where id = #{id}")
    void updateById(Head head);

   @Delete("delete from `head` where id = #{id}")
    void removeById(Integer id);

   @Select("select * from `head`")
    List<Head> list();

   @Select("select * from `head` where user_id = #{id}")
    Head getById(Integer id);

    List<HeadDto> selectByPage(Integer userId, String title, Integer museumId, Integer activityId);
}
